<template>
  <view class="page-join position-r">
    <scroll-view class="page-join__bg pd-v-24 pd-t-24 pd-b-100 box" scroll-y>
        <rich-text :nodes="content"></rich-text>
    </scroll-view>
    <view class="page-join__btn position-a full-w flex flex-center flex-j-center">
        <u-button type="primary" :customStyle="{width:'600rpx'}" shape="circle" color="#35BE65"  text="我要申请加盟" @click="join"></u-button>
    </view>
      
  </view>
</template>

<script setup>

import { useStore } from '@/store/index.js';
import { settingGetInfo } from "@/api/index/index";

import { computed, ref, onMounted, reactive } from "vue";
import { onLoad, onShow } from '@dcloudio/uni-app';

const store = useStore();

const isWx = ref(false)
const redirectURL = ref('/pages/index/index')
const isCheck = ref(false)
const content = ref(``)

onLoad(() => {
    getSettingGetInfo()
    
});

const join = () => {
    uni.navigateTo({
        url: '/sub_user/pages/joinForm/joinForm'
    })
}

const getSettingGetInfo = () => {
    settingGetInfo().then(res => {
        if(res.code == 200) {
            let regex = /(<img\s[^>]*?)src="([^"]*)"/gi;
            let domain = 'https://gechongchong.com';
            // res.data.applyToJoin = res
            res.data.applyToJoin = res.data.applyToJoin.replace(regex, (match, before, src) => {
                return `${before}src="${domain}${src}" style="max-width:100%;height:auto;"`;
            });
            content.value = res.data.applyToJoin
        }
    })
}

</script>

<style lang="scss" scoped>
.page-join {
    height:100vh;
    width: 100vw;

    .page-join__bg {
        width: 100%;
        height: 100%;
    }    

    .page-join__btn {
        left:0;
        bottom:68rpx;
    }
}
</style>
